<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="file" multiple accept="images/*">
    <script>
        document.querySelector('input').addEventListener('change', function (e) {
            console.log(e); //触发事件的元素input
            // e.target.files:伪数组  上传的文件列表;
            console.log(e.target.files[0]); //拿到第一个文件
        })
    </script>
</body>

</html>